package com.jcl.recruit.console;

import com.jcl.recruit.console.mapper.ConsoleUserAccessMapper;
import com.jcl.recruit.console.model.ConsoleUserAccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName ConsoleUserAccessDao
 * @Author yyliu
 * @Date 2018/12/14 9:26
 * @Version 1.0
 **/
@Component
public class ConsoleUserAccessDao implements ConsoleUserAccessMapper {

    @Autowired
    private ConsoleUserAccessMapper consoleUserAccessMapper;

    @Override
    public List<ConsoleUserAccess> findList(String category, Integer... status) {
        return consoleUserAccessMapper.findList(category, status);
    }

    @Override
    public List<ConsoleUserAccess> findListByExternalKey(String externalKey, String category, Integer status) {
        return consoleUserAccessMapper.findListByExternalKey(externalKey, category, status);
    }

    @Override
    public List<ConsoleUserAccess> findListByUsername(String username, String category, Integer status) {
        return consoleUserAccessMapper.findListByUsername(username, category, status);
    }

    @Override
    public ConsoleUserAccess findOneByUsernameAndPw(String username,
                                                    String password,
                                                    String category,
                                                    Integer status) {
        return consoleUserAccessMapper.findOneByUsernameAndPw(username, password, category, status);
    }

    @Override
    public ConsoleUserAccess findOneByExternalKeyAndCode(String externalKey, String corpCode) {
        return consoleUserAccessMapper.findOneByExternalKeyAndCode(externalKey, corpCode);
    }

    @Override
    public ConsoleUserAccess findOneByUserId(Integer userId, String category) {
        return consoleUserAccessMapper.findOneByUserId(userId, category);
    }

    @Override
    public ConsoleUserAccess findOne(Integer id) {
        return consoleUserAccessMapper.findOne(id);
    }

    @Override
    public int changeStatusesToSetting(Integer setStatus, String externalKey, String category, Integer... statuses) {
        return consoleUserAccessMapper.changeStatusesToSetting(setStatus, externalKey, category, statuses);
    }

    @Override
    public int updateUserId(String externalKey, Integer userId, String category) {
        return consoleUserAccessMapper.updateUserId(externalKey, userId, category);
    }

    @Override
    public int add(ConsoleUserAccess entity) {
        return consoleUserAccessMapper.add(entity);
    }

    @Override
    public int update(ConsoleUserAccess entity) {
        return consoleUserAccessMapper.update(entity);
    }
}
